package com.chenliang.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BCryptPasswordEncoderUrils {
    //实例化加密对象
    private static BCryptPasswordEncoder bCryptPasswordEncoder=new BCryptPasswordEncoder();

    /**
     * 将密码进行加密
     * @param password
     * @return
     */
    public static String encodePassword(String password){
        return bCryptPasswordEncoder.encode(password);
    }

    public static void main(String[] args){
        String str="123";
        String pwd=encodePassword(str);
        System.out.println(pwd);
    }
}
